using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace GameUI {
	public class ItemPreviewName:MonoBehaviour {
		void Start() {
			textbox=GetComponent<TextMeshProUGUI>();
		}
		private void Update() {
			if((Interactable.selected as ItemPickup)!=selected) {
				selected=Interactable.selected as ItemPickup;
				if(selected) textbox.text=selected.GetName();
				else textbox.text="";
			}
			if(selected==null&&textbox.text!="") textbox.text="";
		}

		ItemPickup selected;
		TextMeshProUGUI textbox;
	}
}